<template>
  <div class="mallmap_container">
    <!-- 头部内容 -->
    <div class="header">
      <!-- "返回"按钮 -->
      <router-link class="returned" to="/home"><i class="iconfont backarrow"></i></router-link>
      <!-- "天气"插件 -->
      <div class="weather_box">
        <div id="he-plugin-simple"></div>
      </div>
      <!-- "搜索"功能 -->
      <div class="searchFrom" style="display: none">
        <input type="text" name="" id="" value="点击搜索" />
        <button type="button"><i class="iconfont sousuo"></i></button>
      </div>
      <!-- "商场LOGO"内容 -->
      <router-link class="logo" to="/home"><i class="iconfont wandaicon"></i></router-link>
    </div>

    <!-- 主体内容 -->
    <div class="mallmap_box">
      <!-- 标题导航内容 -->
      <div class="title"><i class="iconfont daohang"></i>商场导航</div>
      <!-- 楼层信息切换内容 -->
      <div class="map_content">
        <ul class="tab_title">
          <li @click="cur = 0" :class="{ active: cur == 0 }">L1</li>
        </ul>
        <div class="tab_container">
          <!-- "L1"一楼 -->
          <div v-show="cur == 0" class="tab_content">
            <div class="btns_box" style="display: none">
              <router-link to="#" class="btn_content"
                ><i class="iconfont fangxiang"></i><br />我的方向</router-link
              >
              <router-link to="#" class="btn_content"
                ><i class="iconfont weizhi"></i><br />我的位置</router-link
              >
            </div>
            <p><img :src="mapImgPath" alt="" /></p>
            <ul class="life_navigation">
              <li>
                <router-link to="#"><i class="iconfont weishengjian2 nav1"></i>卫生间</router-link>
              </li>
              <li>
                <router-link to="#"
                  ><i class="iconfont canzhangweishengjian2 nav2"></i>残障卫生间</router-link
                >
              </li>
              <li>
                <router-link to="#"><i class="iconfont futi2 nav3"></i>扶梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont louti2 nav4"></i>楼梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont dianti2 nav5"></i>电梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont muyingshi2 nav6"></i>母婴室</router-link>
              </li>
            </ul>
          </div>

          <!-- "L2"二楼 -->
          <div v-show="cur == 1" class="tab_content" style="display: none">
            <div class="btns_box">
              <router-link to="#" class="btn_content"
                ><i class="iconfont fangxiang"></i><br />我的方向</router-link
              >
              <router-link to="#" class="btn_content"
                ><i class="iconfont weizhi"></i><br />我的位置</router-link
              >
            </div>
            <p><img src="../Mallmap/images/img1.jpg" alt="" /></p>
            <ul class="life_navigation">
              <li>
                <router-link to="#"><i class="iconfont weishengjian2 nav1"></i>卫生间</router-link>
              </li>
              <li>
                <router-link to="#"
                  ><i class="iconfont canzhangweishengjian2 nav2"></i>残障卫生间</router-link
                >
              </li>
              <li>
                <router-link to="#"><i class="iconfont futi2 nav3"></i>扶梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont louti2 nav4"></i>楼梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont dianti2 nav5"></i>电梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont muyingshi2 nav6"></i>母婴室</router-link>
              </li>
            </ul>
          </div>

          <!-- "L3"三楼 -->
          <div v-show="cur == 2" class="tab_content" style="display: none">
            <div class="btns_box">
              <router-link to="#" class="btn_content"
                ><i class="iconfont fangxiang"></i><br />我的方向</router-link
              >
              <router-link to="#" class="btn_content"
                ><i class="iconfont weizhi"></i><br />我的位置</router-link
              >
            </div>
            <p><img src="../Mallmap/images/img1.jpg" alt="" /></p>
            <ul class="life_navigation">
              <li>
                <router-link to="#"><i class="iconfont weishengjian nav1"></i>卫生间</router-link>
              </li>
              <li>
                <router-link to="#"
                  ><i class="iconfont canzhangweishengjian nav2"></i>残障卫生间</router-link
                >
              </li>
              <li>
                <router-link to="#"><i class="iconfont futi nav3"></i>扶梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont louti nav4"></i>楼梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont dianti nav5"></i>电梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont muyingshi nav6"></i>母婴室</router-link>
              </li>
            </ul>
          </div>

          <!-- "L4"四楼 -->
          <div v-show="cur == 3" class="tab_content" style="display: none">
            <div class="btns_box">
              <router-link to="#" class="btn_content"
                ><i class="iconfont fangxiang"></i><br />我的方向</router-link
              >
              <router-link to="#" class="btn_content"
                ><i class="iconfont weizhi"></i><br />我的位置</router-link
              >
            </div>
            <p><img src="../Mallmap/images/img1.jpg" alt="" /></p>
            <ul class="life_navigation">
              <li>
                <router-link to="#"><i class="iconfont weishengjian2 nav1"></i>卫生间</router-link>
              </li>
              <li>
                <router-link to="#"
                  ><i class="iconfont canzhangweishengjian2 nav2"></i>残障卫生间</router-link
                >
              </li>
              <li>
                <router-link to="#"><i class="iconfont futi2 nav3"></i>扶梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont louti2 nav4"></i>楼梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont dianti2 nav5"></i>电梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont muyingshi2 nav6"></i>母婴室</router-link>
              </li>
            </ul>
          </div>

          <!-- "L5"五楼 -->
          <div v-show="cur == 4" class="tab_content" style="display: none">
            <div class="btns_box">
              <router-link to="#" class="btn_content"
                ><i class="iconfont fangxiang"></i><br />我的方向</router-link
              >
              <router-link to="#" class="btn_content"
                ><i class="iconfont weizhi"></i><br />我的位置</router-link
              >
            </div>
            <p><img src="../Mallmap/images/img1.jpg" alt="" /></p>
            <ul class="life_navigation">
              <li>
                <router-link to="#"><i class="iconfont weishengjian nav1"></i>卫生间</router-link>
              </li>
              <li>
                <router-link to="#"
                  ><i class="iconfont canzhangweishengjian nav2"></i>残障卫生间</router-link
                >
              </li>
              <li>
                <router-link to="#"><i class="iconfont futi nav3"></i>扶梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont louti nav4"></i>楼梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont dianti nav5"></i>电梯</router-link>
              </li>
              <li>
                <router-link to="#"><i class="iconfont muyingshi nav6"></i>母婴室</router-link>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// const machineId = window.config.MACHINE_ID;
export default {
  name: 'index',
  data() {
    return {
      cur: 0, // 默认选中第一个tab
      machineId: window.config.MACHINE_ID,
      // mapImgPath: `images/mallmap/${machineId}/map.jpg`,
    };
  },
  computed: {
    mapImgPath() {
      if (this.machineId == undefined || this.machineId === '') {
        return `images/mallmap/map.jpg`;
      }
      return `images/mallmap/${this.machineId}/map.jpg`;
    },
  },
  methods: {},
  created() {
    window.WIDGET = {
      CONFIG: {
        modules: '01234',
        background: '5',
        tmpColor: '404A56',
        tmpSize: '40',
        cityColor: '404A56',
        citySize: '0',
        aqiColor: '404A56',
        aqiSize: '40',
        weatherIconSize: '60',
        alertIconSize: '60',
        padding: '10px 10px 10px 10px',
        shadow: '0',
        language: 'auto',
        fixed: 'false',
        vertical: 'top',
        horizontal: 'left',
        key: 'c96c78edf3474b1585e0067b5b5b8626',
      },
    };
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0';
    document.getElementsByTagName('head')[0].appendChild(script);
  },
};
</script>

<style lang="less" scoped>
.mallmap_container {
  width: 1080px;
  height: 1920px;
  background-color: rgba(248, 248, 248, 0.5);
  .header {
    width: 100%;
    height: 220px;
    margin-bottom: 42px;
    box-sizing: border-box;
    position: relative;
    .weather_box {
      width: auto;
      height: 98px;
      font-weight: bold;
      position: absolute;
      top: 50px;
      left: 220px;
      display: flex;
      justify-content: left;
      align-items: center;
    }
    .returned {
      width: 366px;
      height: 366px;
      color: #fff;
      border-radius: 180px;
      overflow: hidden;
      position: absolute;
      top: 0;
      left: 0;
      transition: 0.5s;
      transform: translate(-40%, -40%);
      background-color: #702fff;
      background-image: -o-linear-gradient(-45deg, #702fff, #70b0ff);
      background-image: -moz-linear-gradient(-45deg, #702fff, #70b0ff);
      background-image: -webkit-linear-gradient(-45deg, #702fff, #70b0ff);
      background-image: linear-gradient(-45deg, #702fff, #70b0ff);

      &:hover,
      &:active {
        transition: 0.5s;
        transform: translate(-35%, -35%);
        background-image: -o-linear-gradient(-45deg, #4526ff, #70baff);
        background-image: -moz-linear-gradient(-45deg, #4526ff, #70baff);
        background-image: -webkit-linear-gradient(-45deg, #4526ff, #70baff);
        background-image: linear-gradient(-45deg, #4526ff, #70baff);
        & > .iconfont {
          transition: 0.5s;
          font-size: 5.5rem;
        }
      }
      & > .iconfont {
        transition: 0.5s;
        font-size: 5rem;
        position: absolute;
        left: 52%;
        top: 55%;
      }
    }

    .logo {
      width: 108px;
      height: 108px;
      display: flex;
      justify-content: center;
      align-items: center;
      color: #e30016;
      float: right;
      margin: 42px 60px 0 0;
      & > .iconfont {
        font-size: 6rem;
      }
    }
    .searchFrom {
      width: 378px;
      height: 74px;
      border-radius: 37px;
      overflow: hidden;
      position: absolute;
      top: 26%;
      left: 46%;
      background-color: #fff;
      box-shadow: 0 0 20px rgba(109, 93, 253, 0.2);

      &:hover,
      &:active,
      &:focus {
        box-shadow: 0 0 20px rgba(80, 61, 255, 0.5);
      }
      input {
        width: 378px;
        height: 74px;
        display: flex;
        justify-content: left;
        align-items: center;
        padding: 0 70px 0 30px;
        box-sizing: border-box;
        font-size: 1.8rem;
        color: #6d7784;
      }
      button {
        width: 42px;
        height: 42px;
        border: 0;
        background-color: transparent;
        background-image: none;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        right: 26px;
        top: 16px;
        color: #9eb3cd;
        cursor: pointer;
        &:hover,
        &active {
          color: #4757fd;
        }
        & > .iconfont {
          font-size: 2.6rem;
        }
      }
    }
  }
  .mallmap_box {
    width: 100%;
    padding: 30px 60px;
    .title {
      width: 100%;
      height: 116px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 2.8rem;
      color: #404a56;
      font-weight: bold;
      background-color: #fff;
      border-radius: 60px;
      overflow: hidden;
      box-shadow: 0 0 40px rgba(92, 97, 219, 0.2);

      & > .iconfont {
        font-size: 4.4rem;
        background-image: -o-linear-gradient(to top, #5000ff, #4196fd);
        background-image: -moz-linear-gradient(to top, #5000ff, #4196fd);
        background-image: -webkit-linear-gradient(to top, #5000ff, #4196fd);
        background-image: linear-gradient(to top, #5000ff, #4196fd);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        margin-right: 24px;
        font-weight: initial;
      }
    }
  }
  .map_content {
    width: 100%;
    height: auto;
    position: relative;
    margin-top: 60px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    .tab_title {
      width: 80px;
      position: absolute;
      left: 0%;
      top: 0%;
      & > li {
        width: 80px;
        height: 80px;
        font-size: 2.2rem;
        color: #404a56;
        font-weight: normal;
        float: left;
        line-height: 80px;
        text-align: center;
        overflow: hidden;
        background-color: #fff;
        border-radius: 10px;
        margin-bottom: 30px;
        box-shadow: 0 0 20px rgba(111, 69, 254, 0.2);
        cursor: pointer;
      }
      /* 点击对应的标题添加对应的背景颜色 */
      .active {
        color: #fff;
        font-weight: bold;
        background-color: #7134fe;
        background-image: linear-gradient(to top, #7134fe, #66a5fc);
        background-image: -o-linear-gradient(to top, #7134fe, #66a5fc);
        background-image: -moz-linear-gradient(to top, #7134fe, #66a5fc);
        background-image: -webkit-linear-gradient(to top, #7134fe, #66a5fc);
        box-shadow: 0 0 20px rgba(111, 69, 254, 0.4);
      }
    }
    .tab_container {
      width: 850px;
      float: right;
      position: relative;
      .tab_content {
        width: 100%;
        p {
          width: 100%;
          height: 730px;
          border-radius: 10px;
          display: flex;
          justify-content: center;
          align-items: flex-start;
          & > img {
            width: 100%;
            height: auto;
            border-radius: 16px;
          }
        }
        .btns_box {
          width: 80px;
          line-height: 32px;
          background-color: #fff;
          border-radius: 10px;
          padding: 10px 0;
          overflow: hidden;
          position: absolute;
          top: 0;
          right: 0;
          box-shadow: 0 0 20px rgba(111, 69, 254, 0.2);
          .btn_content {
            width: 100%;
            text-align: center;
            margin: 10px 0;
            display: inline-block;
            font-size: 1rem;
            color: #727a95;

            & > .iconfont {
              font-size: 2.2rem;
              background-image: -o-linear-gradient(to top, #5000ff, #4196fd);
              background-image: -moz-linear-gradient(to top, #5000ff, #4196fd);
              background-image: -webkit-linear-gradient(to top, #5000ff, #4196fd);
              background-image: linear-gradient(to top, #5000ff, #4196fd);
              -webkit-background-clip: text;
              background-clip: text;
              -webkit-text-fill-color: transparent;
              color: transparent;
            }
          }
        }
        .life_navigation {
          width: 100%;
          display: flex;
          justify-content: center;
          align-items: flex-start;
          margin-top: 60px;
          & > li {
            width: auto;
            margin: 0 10px;
            text-align: center;
            a {
              font-size: 1.2rem;
              color: #727a95;
              text-decoration: none;

              &:hover,
              &active,
              &:focus {
                color: #0e0641;
              }

              & > .iconfont {
                font-size: 3.4rem;
                display: flex;
                justify-content: center;
                align-content: center;
                padding-bottom: 10px;
                box-sizing: border-box;
                -webkit-background-clip: text;
                background-clip: text;
                -webkit-text-fill-color: transparent;
                color: transparent;
                font-weight: normal;
              }

              & > .nav1 {
                background-image: -o-linear-gradient(to top, #5000ff, #4196fd);
                background-image: -moz-linear-gradient(to top, #5000ff, #4196fd);
                background-image: -webkit-linear-gradient(to top, #5000ff, #4196fd);
                background-image: linear-gradient(to top, #5000ff, #4196fd);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #5000ff, #4196fd);
                  background-image: -moz-linear-gradient(to bottom, #5000ff, #4196fd);
                  background-image: -webkit-linear-gradient(to bottom, #5000ff, #4196fd);
                  background-image: linear-gradient(to bottom, #5000ff, #4196fd);
                }
              }

              & > .nav2 {
                background-image: -o-linear-gradient(to top, #3968e2, #55e3b6);
                background-image: -moz-linear-gradient(to top, #3968e2, #55e3b6);
                background-image: -webkit-linear-gradient(to top, #3968e2, #55e3b6);
                background-image: linear-gradient(to top, #3968e2, #55e3b6);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #3968e2, #55e3b6);
                  background-image: -moz-linear-gradient(to bottom, #3968e2, #55e3b6);
                  background-image: -webkit-linear-gradient(to bottom, #3968e2, #55e3b6);
                  background-image: linear-gradient(to bottom, #3968e2, #55e3b6);
                }
              }

              & > .nav3 {
                background-image: -o-linear-gradient(to top, #fb4659, #ebcc57);
                background-image: -moz-linear-gradient(to top, #fb4659, #ebcc57);
                background-image: -webkit-linear-gradient(to top, #fb4659, #ebcc57);
                background-image: linear-gradient(to top, #fb4659, #ebcc57);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #fb4659, #ebcc57);
                  background-image: -moz-linear-gradient(to bottom, #fb4659, #ebcc57);
                  background-image: -webkit-linear-gradient(to bottom, #fb4659, #ebcc57);
                  background-image: linear-gradient(to bottom, #fb4659, #ebcc57);
                }
              }

              & > .nav4 {
                background-image: -o-linear-gradient(to top, #7500ff, #ba50f7);
                background-image: -moz-linear-gradient(to top, #7500ff, #ba50f7);
                background-image: -webkit-linear-gradient(to top, #7500ff, #ba50f7);
                background-image: linear-gradient(to top, #7500ff, #ba50f7);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #7500ff, #ba50f7);
                  background-image: -moz-linear-gradient(to bottom, #7500ff, #ba50f7);
                  background-image: -webkit-linear-gradient(to bottom, #7500ff, #ba50f7);
                  background-image: linear-gradient(to bottom, #7500ff, #ba50f7);
                }
              }

              & > .nav5 {
                background-image: -o-linear-gradient(to top, #9a3ad8, #ffcb48);
                background-image: -moz-linear-gradient(to top, #9a3ad8, #ffcb48);
                background-image: -webkit-linear-gradient(to top, #9a3ad8, #ffcb48);
                background-image: linear-gradient(to top, #9a3ad8, #ffcb48);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #9a3ad8, #ffcb48);
                  background-image: -moz-linear-gradient(to bottom, #9a3ad8, #ffcb48);
                  background-image: -webkit-linear-gradient(to bottom, #9a3ad8, #ffcb48);
                  background-image: linear-gradient(to bottom, #9a3ad8, #ffcb48);
                }
              }

              & > .nav6 {
                background-image: -o-linear-gradient(to top, #d9567a, #dc83e5);
                background-image: -moz-linear-gradient(to top, #d9567a, #dc83e5);
                background-image: -webkit-linear-gradient(to top, #d9567a, #dc83e5);
                background-image: linear-gradient(to top, #d9567a, #dc83e5);

                &:hover,
                &active,
                &:focus {
                  background-image: -o-linear-gradient(to bottom, #d9567a, #dc83e5);
                  background-image: -moz-linear-gradient(to bottom, #d9567a, #dc83e5);
                  background-image: -webkit-linear-gradient(to bottom, #d9567a, #dc83e5);
                  background-image: linear-gradient(to bottom, #d9567a, #dc83e5);
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>
